package com.aegis.gateway.service;

import com.aegis.gateway.model.AppInfo;
import com.aegis.gateway.service.cache.CacheService;
import com.aegis.gateway.service.cache.LocalCacheService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

/**
 * @Author wuweixin
 *
 * @Version 1.0
 * @Descritube
 */
@EnableScheduling
@Slf4j
@Service("scheduleTaskService")
public class ScheduleTaskService {

    @Autowired
    private CacheService<AppInfo> cacheService;


    @Scheduled(cron = "0 * * * * ? ")
    public void syncCache() {
        cacheService.syncCache();
    }


}
